package cn.iocoder.yudao.module.blog.convert.jiutag;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;

import cn.iocoder.yudao.module.blog.convert.jiutagclassity.BlogJiuTagClassityConvert;
import cn.iocoder.yudao.module.blog.dal.dataobject.jiutagclassity.BlogJiuTagClassityDO;
import lombok.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.blog.controller.admin.jiutag.vo.*;
import cn.iocoder.yudao.module.blog.dal.dataobject.jiutag.BlogJiuTagDO;

/**
 * 案例标签分类 Convert
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogJiuTagConvert {

    BlogJiuTagConvert INSTANCE = Mappers.getMapper(BlogJiuTagConvert.class);

    BlogJiuTagDO convert(BlogJiuTagCreateReqVO bean);

    BlogJiuTagDO convert(BlogJiuTagUpdateReqVO bean);

    BlogJiuTagRespVO convert(BlogJiuTagDO bean);

    List<BlogJiuTagRespVO> convertList(List<BlogJiuTagDO> list);

    default List<BlogJiuTagRespVO> convertList(List<BlogJiuTagDO> list, Map<Long, BlogJiuTagClassityDO> classityMap){
        List<BlogJiuTagRespVO> respVOList = convertList(list);
        for(BlogJiuTagRespVO respVO : respVOList){
            respVO.setClassityItem(BlogJiuTagClassityConvert.INSTANCE.convert(classityMap.get(respVO.getClassity())));
        }

        return respVOList;
    }

    PageResult<BlogJiuTagRespVO> convertPage(PageResult<BlogJiuTagDO> page);

    List<BlogJiuTagExcelVO> convertList02(List<BlogJiuTagDO> list);

}
